<!--
 * 功能： 欢迎页-在该页面做初始化动作,然后判断是进登录页还是主页
 * 作者： caihan
 * 日期:  2021-05-19
 -->
<template>
	<view class="wrap-main">
	</view>
</template>

<script>
	// import {
	// 	checkUpdate
	// } from '@/pages/version/version.js';
	// import MixinsEventBus from '@/mixins/mixins-event-bus.js';
	export default {
		// mixins: [MixinsEventBus],
		components: {},
		data() {
			return {

			}
		},
		computed: {
			//计算属性
		},
		onBackPress() {
			uni.hideKeyboard();
		},
		onLoad: function(options) {
			// checkUpdate(false);
			// this.eventBusMixinOn('versionUpdate', (event) => {
			// 	this.delayNav();
			// })
			this.delayNav();
		},
		onShow: function() {},
		methods: {
			delayNav: function() {
				setTimeout(() => {
					this.goHome();
				}, 1000);
			},
			goHome: function() {
				this.$navTo(`/pages/main/home`, "switchTab");
			},
			goLogin: function() {
				this.$appUser.logout()
					.then(res => {
						this.$navTo('/pages/login/login', 'reLaunch');
					})
					.catch(err => {});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrap-main {
		padding-bottom: 0;
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}
</style>
